
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>文字2</title>
</head>
<body >
<canvas id="canvas" style="display: block;margin: 0 auto;border: 1px solid #aaa">
    您的浏览器不支持canvas
</canvas>
<script>
    window.onload=function(){
        var canvas=document.getElementById("canvas");
        canvas.width=800;
        canvas.height=800;
        var context=canvas.getContext("2d");
        context.globalAlpha=0.7;
        context.globalCompositeOperation="source-over";
        for(var i=0;i<100;i++){
            var R=Math.floor(Math.random()*255);
            var G=Math.floor(Math.random()*255);
            var B=Math.floor(Math.random()*255);
            context.fillStyle="rgb("+R+","+G+","+B+")";
            context.beginPath();
            context.arc(Math.random()*canvas.width,Math.random()*canvas.height,Math.random()*100,0,Math.PI*2);
            context.fill();
        }

    }
</script>
</body>
</html>